<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
        <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>  
         <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
        
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		var keyword = "${requestScope.cvo.ivo.keyword}";
		$(":input[name=update]").click(function(){
			location.href = "${initParam.root}info/infoUpdate_view.moja?keyword=" + keyword;
		});
		$(":input[name=delete]").click(function(){
			if(confirm("삭제하시겠습니까?")){
				location.href = "${initParam.root}info/infoDelete.moja?keyword=" + keyword;
			}
		});
	});
</script>
 <style>
.gray {
   color: #e9e9e9;
/*    border: solid 1px #555;
 */   background: #6e6e6e;
   background: -webkit-gradient(linear, left top, left bottom, from(#888), to(#575757));
   background: -moz-linear-gradient(top,  #888,  #575757);
   filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#888888', endColorstr='#575757');
}

</style>

<body>
<div id="mainCss">
<br>
<hr>
<div id="allContents">
	<div id="infoContents">
<h1><font>${requestScope.cvo.ivo.keyword}</font></h1>
<font><b>대분류 : </b></font><input size="5" type="text" value = "${requestScope.cvo.ivo.category}" readonly>
<font><b>중분류 : </b></font> <input size="5" type="text" value = "${requestScope.cvo.ivo.division}" readonly>
<hr>
<c:if test="${requestScope.cvo.ivo.section != null }">
<font><b>소분류 : </b></font> <input size="5" type="text" value = "${requestScope.cvo.ivo.section}" readonly>
</c:if>
<br>
 <textarea cols="75" rows="15" readonly>${requestScope.cvo.ivo.contents} </textarea><br><br>
      <input type="button" name = "update" value="정보수정" class="gray">
      <input type="button" name = "delete" value="삭제"  class="gray">
      <a href = "${initParam.root }member/home.moja">
	<input type = "submit" value = "검색 홈" class="gray">
</a>
	</div>
	<br><hr>
	<div id="itemContents">
	<c:choose>
		<c:when test="${fn:length(requestScope.cvo.list)==0 }">
		<table>
		<thead>
			<th colspan="6">
				<font>${requestScope.cvo.ivo.keyword}를 포함하는 상품이 없습니다.</font>
			</th>
		</thead>
		
		</table>
		
		</c:when>
		<c:otherwise>
			<table>
		<thead>
			<th>상품번호</th><th>상품명</th><th>상품 소개</th>
			<th>판매자</th><th>상품가격</th><th>상품등록일</th>
			<!-- <th>카테고리</th> -->
		</thead>
		<c:forEach items="${requestScope.cvo.list }" var="list">
				<tr>
				<td><a href="${initParam.root}item/showItemContent.moja?itemNo=${list.itemNo}&memberId=${list.memberId}"/>${list.itemNo }</td>
				<td><a href="${initParam.root}item/showItemContent.moja?itemNo=${list.itemNo}&memberId=${list.memberId}"/>${list.itemName}</td>
				<td><a href="${initParam.root}item/showItemContent.moja?itemNo=${list.itemNo}&memberId=${list.memberId}"/>${list.itemInfo }</td>
				<td><a href="${initParam.root}item/showItemContent.moja?itemNo=${list.itemNo}&memberId=${list.memberId}"/>${list.memberId }</td>
				<td><a href="${initParam.root}item/showItemContent.moja?itemNo=${list.itemNo}&memberId=${list.memberId}"/>${list.itemPrice }</td>
				<td><a href="${initParam.root}item/showItemContent.moja?itemNo=${list.itemNo}&memberId=${list.memberId}"/>${list.uploadDate }</td>
				<%-- <td>${list.category}</td> --%>
				</tr>
			
		</c:forEach>
	</table>
		</c:otherwise>
	</c:choose>

	
	
	</div>
</div>
</div>
</body>
</html> 